package com.codyy.lib_common.base.activity

import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding

abstract class BaseDataBindingActivity<DB : ViewDataBinding> : BaseActivity() {

    lateinit var mDataBinding: DB

    override fun setContentLayout() {
        mDataBinding = DataBindingUtil.setContentView(this, getLayoutRes())
        mDataBinding.lifecycleOwner = this
        initView()
        initData()
    }

    override fun onDestroy() {
        super.onDestroy()
        mDataBinding.unbind()
    }

}